package com.ctcemti.mdm.project.sys.service;


import com.ctcemti.mdm.common.result.Result;
import com.ctcemti.mdm.project.sys.entity.OrgOrganization;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface ICompanyService{
    /**
     * 添加/修改组织
     * @param orgOrganization
     * @return
     */
    Result insertOrUpdate(OrgOrganization orgOrganization);

    /**
     * 导入组织
     * @param orgs
     * @return
     */
    Result importOrgs(List<OrgOrganization> orgs);

    /**
     * 删除
     * @param orgOrganization
     * @return
     */
    Result delete(OrgOrganization orgOrganization);

    /**
     * 根据父级ID获取数据用于生成树状结构
     * @return
     */
    Result<List<OrgOrganization>> getByPid(String pid);

    /**
     * 根据USERID生成组织树
     * @param personId
     * @return
     */
    Result<List<OrgOrganization>> getByPersonId(String personId);

    /**
     * 根据id获取所有子节点
     * @param id
     * @return
     */
    List<OrgOrganization> selectChildById(String id) ;

    /* *
     * @Author bxf
     * @Description 获取根节点
     * @Date 11:29 2019/8/30
     * @param
     * @return java.util.List<com.ctcemti.mdm.project.sys.entity.OrgOrganization>
     */
    List<OrgOrganization> selectRootById() ;
    /* *
     * @Author bxf
     * @Description 获取administrator数据组织树
     * @Date 14:48 2019/8/30
     * @param request
     * @return com.ctcemti.mdm.common.result.Result<java.util.List<com.ctcemti.mdm.project.sys.entity.OrgOrganization>>
     */
    Result<List<OrgOrganization>> getByPersonIdForAdministrator(HttpServletRequest request);


    List<OrgOrganization> getOrgForTreeByName(HttpServletRequest request, String shortName, String loginId);
}
